<table class="table table-striped">
  <tr>
    <td>序号</td>
    <td>product</td>
    <td>qty</td>
    <td></td>
  </tr>
  <tr ng-repeat="item in viewLines">
    <td>{{$index+1}}</td>
    <td>
      <select style="max-width: 150px" class="form-control"
              ng-options="s_item.name for s_item in products track by s_item.id" ng-model="item.product"/>
    </td>
    <td>
      <input type="text" value="{{item.pivots | qtyAll}}" ng-click="input_qtys(item)"/>

    </td>
    <td>
      <span class="pull-right btn-group" style="margin-top: 7px;">
        <a ng-click="delete($index)">删除</a>
      </span>
    </td>
  </tr>
</table>

<!-- Modal -->
<div class="modal fade" id="qtyInputModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
     aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
          aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="exampleModalLabel">New message</h4>
      </div>
      <div class="modal-body">
        <table>
          <tr>
            <td style="width: 100px"></td>
            <td ng-repeat="size in viewLine.sizes">
              {{size.name}}
            </td>
          </tr>
          <tr ng-repeat="color in viewLine.colors">
            <td>{{color.name}}</td>
            <td ng-repeat="size in viewLine.sizes">
              <input style="width:80px" type="text" ng-model="viewLine.pivots[color.id][size.id]"/>
            </td>
          </tr>
        </table>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
      </div>
    </div>
  </div>
</div>
